/*
 * marketsim-eclipsetrader
 *
 * Copyright (C) 2008-2011 Steve Phelps and John Cartlidge
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 */
/*
 *  (C) Victria Ltd. 2007
 */
package victria.marketsim.event;

import java.io.Serializable;
import java.util.Date;

public abstract class MarketEvent implements Serializable {

	protected Date timeStamp;
	
	public MarketEvent(Date time) {
		super();
		this.timeStamp = new java.sql.Date(time.getTime());
	}
	
	public MarketEvent() {
		this.timeStamp = new java.sql.Date(new Date().getTime());
	}
	
	public Date getTimeStamp() {
		return timeStamp;
	}
	
	public void setTimeStamp(Date time) {
		this.timeStamp = time;
	}
	
	public String getTimeGmt() {
		return timeStamp.toGMTString();
	}
	
	public java.sql.Time getTimeSql() {
		return new java.sql.Time(timeStamp.getTime());
	}
	
	public java.sql.Date getDateSql() {
		return new java.sql.Date(timeStamp.getTime());
	}

	public String toPrettyString() {
		return getShortDescription() + ": " + getLongDescription();
	}
	
	public abstract String getShortDescription();
	public abstract String getLongDescription();
	public abstract int getId();
	
}
